<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
          <tr>
            <td nowrap class="containerSubtabLabel"></td>
            <td width="100%" class="containerSubtabSpace">&nbsp;</td>
          </tr>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" class="conSubs">
          <tr>
            <td class="conSubOff" nowrap><a href="gotoPage('/crm/sale/CustomerContactsDet')">基本信息</a></td>
            <td class="conSubOn" nowrap><a href="gotoPage('/crm/sale/contacts/PotentialContactsEmail')">邮件</a></td>
            <td class="conSubOff" nowrap><a href="gotoPage('/crm/sale/contacts/PotentialContactsMess')">短信</a></td>
            <td class="conSubOff" nowrap><a href="gotoPage('/crm/sale/contacts/ContactsBusinessOpport')">商机管理</a></td>
            <td class="conSubOff" nowrap><a href="gotoPage('/crm/sale/contacts/ContactsOffer')">产品报价</a></td>
            <td class="conSubOff" nowrap><a href="gotoPage('/crm/sale/ContactsArchives')">文档</a></td>
          </tr>
          <tr>
          </tr>
        </table>
        <el-form ref="form" :model="fasongqingkuangmingxi" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="gotoPage('/crm/sale/contacts/PotentialContactsNewEmail?'+vueparams+'')" type='primary' size="mini">发送邮件</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 发送情况 </span>
          </div>
          <el-table :data="fasongqingkuangmingxi">
            <el-table-column label="主题" prop="campaign_id">
              <template slot-scope="scope">
                <el-link @click="gotoPage('/crm/sale/contacts/PotentialContactsEmailDet?campaign_id='+scope.row.campaign_id+''+vueparams+'')" type='primary'>{{scope.row.subject}}</el-link>
              </template>
            </el-table-column>
            <el-table-column label="发送状态" prop="status">
            </el-table-column>
            <el-table-column label="发送给" prop="replyMail">
            </el-table-column>
            <el-table-column label="存入系统管理" prop="">
              <template slot-scope="scope">
                <el-link @click="gotoPage(''+vueparams+'')" type='primary'>{{scope.row['']}}</el-link>
              </template>
            </el-table-column>
          </el-table>
          <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
        </el-form>
        <el-menu-item v-for='item in Container1'>
          <el-link @click="gotoMenu(item.url)" :type="'邮件'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
        </el-menu-item>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'联系人'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'CustomerContactsEmail',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        fasongqingkuangmingxi: [],
        loading: false,
        Container: null,
        Container1: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "80299289AF2443B18EA545A4C0C37170",
        name: "客户管理右菜单",
        selected: "联系人"
      }, 'Container', this.vueparams);
      this.loadContainerMenu({
        pid: "14ED91704E794C43A973E8BEFF724C15",
        name: "客户联系人右菜单",
        selected: "邮件"
      }, 'Container1', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/crm/sale/CustomerAction/customerContactsEmail?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
